<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 java.util.ArrayList"%>
<%@ page import="com.scalar.chiptrack.users.User" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/systemJobSetup.do"/>

<html:html locale="true">

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel=stylesheet>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >

<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
</script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js">
</script>

<script language='javascript'>

function save()
{
    document.systemJobSetupForm.action.value = 'saveEmailUserIds';
    document.systemJobSetupForm.submit();
}
function reset(){
    document.systemJobSetupForm.reset();
}

</script>


<!-- from here your body starts -->

<html:form name="systemJobSetupForm" type="com.scalar.chiptrack.users.forms.SystemJobSetupForm" action="/systemJobSetup.do">
<table border="0" width="100%" align="center">
	<tr><td bgcolor="#993333" align="center" class="NArialW"><font color='#FFFFFF'>User's Mail IDs</font></td></tr>
</table>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>
<nested:nest property="job">
<table border="0" width="90%" align="right">
	<tr>
		<td width="100%">
			<table border="0" width="100%" cellspacing='10' cellpadding='2' align='left'>
				<tr>
					<td align=right>
						 <a href="javascript:window.close();" title='Click here to close this window' onMouseOver="window.status='Click here to close this window';return true"><font class='NArialL'><b>[Close this window]</b></font></a>
					</td>
				</tr>
				<tr><td><chiptrack:errors styleClass='NArialL' /></td></tr>
				<tr><td><chiptrack:info styleClass='NArialL' /></td></tr>
				<tr><td align="left" class='NArialL'><FONT id="errors" styleClass="NArialL" color='FF0000'></font></td></tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<%
			   ArrayList users = (ArrayList) request.getAttribute("users");
				if( users != null && users.size() != 0 ) { %>
			   <table border="0" width="70%" align="center">
                    <tr>
                        <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Select</font></font></td>
                        <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">User Name</font></font></td>
                        <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Email</font></font></td>
                    </tr>
                    <% int bgcount = 0;%>
                    <logic:iterate id="user" name="users" type="com.scalar.chiptrack.users.User">
                    <% bgcount++; %>
                    <tr>
                        <td nowrap width="5%" align="left" bgcolor='<%=bgcount%2==0 ? "#DEE1E2" : "#FFFFEE"%>'><font class="NArialL">
                             <nested:multibox property="emailUserId" value="<%=user.getUserId()%>"/>
                        </font></td>
                        <td nowrap width="15%" align="left" bgcolor='<%=bgcount%2==0 ? "#DEE1E2" : "#FFFFEE"%>'><font class="NArialL">
                        <bean:write name="user" property="firstName" />&nbsp;<bean:write name="user" property="lastName" /></font></td>
                        <td nowrap width="15%" align="left" bgcolor='<%=bgcount%2==0 ? "#DEE1E2" : "#FFFFEE"%>'><font class="NArialL">
                        <bean:write name="user" property="email" /></font></td>
                    </tr>
                    </logic:iterate>
                    <tr><td class="NArialL" colspan=5><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=50></td></tr>
                    <tr>
                        <td colspan=3 align=center>
                            <a href="javascript:save()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17"></a>
                            <a href="javascript:reset()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17"></a>
                        </td>
                    </tr>
				</table>
				<% }
				else
				{ %>
                    <table border="0" width="70%" align="center">
						<tr>
							<td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Select</font></font></td>
							<td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Contact Person</font></font></td>
							<td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Email</font></font></td>

						</tr>
						<tr>
							<td colspan="3" align="center" bgcolor="#FFFFEE"><font class="NArialL">
							<< Records not found >> </font>
							</td>
						</tr>
					</table>
				<%
				}
				%>
		</td>
	</tr>
</table>
<nested:hidden property="id"/>
</nested:nest>
<input type="hidden" name="action" value="">
</html:form>

</body>

</html:html>